import java.util.List;

import twitter4j.conf.ConfigurationBuilder;
import twitter4j.DirectMessage;
import twitter4j.ResponseList;
import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;

public class TwitterWeb {
	
	public void iniciar() throws TwitterException{
		ConfigurationBuilder cb = new ConfigurationBuilder();
		cb.setDebugEnabled(true)
		  .setOAuthConsumerKey("GPOdJmhYDp4pUjUD9DQ")
		  .setOAuthConsumerSecret("FA0xvntzMbd2V5eu9eTc6RrlAXEKScNdYHpAdlKmic")
		  .setOAuthAccessToken("2167694672-Xu2OtTyegpNBNVW0gUFkVekJ3niVBYI1YmLi1it")
		  .setOAuthAccessTokenSecret("6vFOgq8yHM72WBMLow4DxXFv1m6ETaybE4QzA0rUw0iyG");
		
		Twitter twitter = new TwitterFactory(cb.build()).getInstance();
		
		List<Status> statuses = twitter.getHomeTimeline();
	    System.out.println("Showing home timeline.");
	    for (Status status : statuses) {
	        System.out.println(status.getUser().getName() + ":" +
	                           status.getText());
	    }
	}
	
}
